package org.example.controller;

import org.example.config.ThreadPoolConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ThreadPoolExecutor;

@RestController
public class TestController {
@Autowired
    ThreadPoolConfig threadPoolConfig;
   @GetMapping
    public void test(){
       ThreadPoolExecutor threadPoolExecutor = threadPoolConfig.messageConsumeDynamicExecutor();

       threadPoolExecutor.execute(()->{
           System.out.println(Thread.currentThread().getName());
       });
   }

}
